import java.net.InetAddress;

public class InetAddressTest {
    public static void main(String[] args) {
        try {
            InetAddress address = InetAddress.getByName("192.168.0.117");
            System.out.println(address.getHostAddress());
        } catch (Exception e) {
            e.printStackTrace();
        }

        System.out.println("-----------------------");
        InetAddress address2 = InetAddress.getLoopbackAddress();
        System.out.println(address2.getHostAddress());
        System.out.println(address2.getHostName());
    }
}
